<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div{
      position: relative;
    }
    img{
      display: block;
    }
    #img1{
      width: 100px;
      height: 100px;
      position: fixed;
      top: 50%;
      right: 0%;
    }
    #img2{
      width: 200px;
      height: 200px;
      position: fixed;
      top: 50%;
      right: 150px;
    }
    .in{
      display: none;
    }
  </style>
</head>
<body>
  <div>
    <img src="./img/ewm2.png" alt="" id="img1">
    <img src="./img/ewm1-.png" alt="" id="img2" class="in">
  </div>
  <script>
    var img1 = document.getElementById("img1");
    var img2 = document.getElementById("img2");
    img1.onmouseout = function() {
      img2.classList.add("in")
      console.log("44");
    }
    img1.onmouseover = function () {
      img2.classList.remove("in")
    }

  </script>
</body>
</html>